package com.example.weather_app;

import android.content.Context;

import org.jetbrains.annotations.Contract;

public class PhotoSelect {
    public static int getBackgroundResource(String weather) {
        switch (weather) {
            case "晴":
                return R.drawable.sun_background;
            case "多云":
            case"阴":
                return R.drawable.cloudy_backgroound;
            case "小雨":
            case "中雨":
            case "大雨":
            case "暴雨":
                return R.drawable.rain_background;
            case "小雪":
            case "中雪":
            case "大雪":
            case "暴雪":
                return R.drawable.snow_background;
            default:
                return R.drawable.sun_background;
        }
    }
    @Contract(pure = true)
    public static int what_weather(String weather){
        int iconResId;
        switch (weather) {
            case "晴":
                iconResId = R.drawable.sun;
                break;
            case "多云":
                iconResId = R.drawable.cloudy;
                break;
            case "阴":
                iconResId = R.drawable.cloudy_night;
                break;
            case "小雨":
                iconResId = R.drawable.rain_s;
                break;
            case "中雨":
                iconResId = R.drawable.rain_m;
                break;
            case "大雨":
                iconResId = R.drawable.rain_l;
                break;
            case "暴雨":
                iconResId = R.drawable.rain_ll;
                break;
            case "雷阵雨":
                iconResId = R.drawable.thundery;
                break;
            case "小雪":
                iconResId = R.drawable.snow_s;
                break;
            case "中雪":
                iconResId = R.drawable.snow_m;
                break;
            case "大雪":
                iconResId = R.drawable.snow_l;
                break;
            case "暴雪":
                iconResId = R.drawable.snow_ll;
                break;
            case "雾":
                iconResId = R.drawable.foggy;
                break;
            case "霾":
                iconResId = R.drawable.haze;
                break;
            case "沙尘暴":
                iconResId = R.drawable.sandstorms;
                break;
            default:
                iconResId = R.drawable.sun;
                break;
        }
        return iconResId;
    }
}
